{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">


    <form class="layui-form">
    <div class="layui-card">
        <div class="layui-card-header">{$company.title}</div>
        <div class="layui-card-body">
            <div class="layui-row layui-form-item">
                <label class="layui-form-label">分配客服：</label>
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$company.id}">
                    <select name="kf_id" >
                        {volist name="kf_list" id="vo"}
                        {eq name="vo.id" value="$company['kf_id']"}
                        <option value="{$vo.id}" selected="selected">{$vo.username}</option>
                        {else/}
                        <option value="{$vo.id}" >{$vo.username}</option>
                        {/eq}
                        {/volist}
                    </select>
                </div>
            </div>

            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="btnSave">保存</button>
                        <a class="layui-btn layui-btn-primary" href="javascript:parent.location.reload();">返回</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>

</div>
{/block}

{block name="script"}
<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: '/lib/index' //主入口模块
    }).use(['index', 'table', 'jquery', 'layer', 'form', 'element', 'upload','laydate'], function () {
        var $ = layui.$,
            layer=layui.layer,
            form = layui.form,laydate = layui.laydate;


        form.on('submit(btnSave)', function (res) {
             // console.log(res.field);
            $.post("{:url('edit')}",res.field, function (result) {
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });


    });

</script>
{/block}


